/**
 *
 */
package com.smart.common.exception;


import com.smart.common.enums.ErrorCode;

public class BaseException extends RuntimeException {

    private static final long serialVersionUID = -3790783705775597432L;

    /**
     * 错误码
     */
    private ErrorCode errorCode;
    /**
     * 消息参数
     */
    private Object params;

    public BaseException(String msg) {
        super(msg);
        this.errorCode = errorCode;
    }

    public BaseException(ErrorCode errorCode, String msg) {
        super(msg);
        this.errorCode = errorCode;
    }

    public BaseException(ErrorCode errorCode, Exception e) {
        super(e);
        this.errorCode = errorCode;
    }

    public BaseException(ErrorCode errorCode, String msg, Exception e) {
        super(msg, e);
        this.errorCode = errorCode;
    }

    public BaseException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.errorCode = errorCode;
    }

    public BaseException(ErrorCode errorCode, Object params) {
        super();
        this.errorCode = errorCode;
        this.params = params;
    }

    public Object getParams() {
        return params;
    }

    public void setParams(Object params) {
        this.params = params;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }


}
